package com.example.clooweather.util;

import android.util.Log;

import okhttp3.OkHttpClient;
import okhttp3.Request;

/**
 * Created by 李明洋~ on 2018/3/12.
 * //发起网络请求类
 */

public class HttpUtil {
    //对OkHttp进行封装 我们在发起一条网络请求时只需调用sendOkHttpRequest并传入请求地址
    //并且注册一个回调来处理服务器的相应就可以了
    public static void sendOkHttpRequest(String address, okhttp3.Callback callback) {
        OkHttpClient client = new OkHttpClient();
        Request request = new Request.Builder().url(address).build();
        Log.d("HHHHHHHH", address);
        client.newCall(request).enqueue(callback);
    }
}
